<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- 矢量图标库 -->
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_388406_82k3oi8je2x7ds4i.css">
<!-- easyui主题 -->
<link rel="stylesheet" type="text/css" href="/easyui/themes/gray/easyui.css">
<!--easyui拖拽  -->
<link rel="stylesheet" type="text/css" href="/easyui/themes/portal.css">

<link rel="stylesheet" type="text/css" href="/css/common.css">
<!-- 根据用户选择的皮肤选择不同css -->
<#if userinfo.skin=='red'>
	<link rel="stylesheet" type="text/css" href="/css/common-red.css">
<#elseif userinfo.skin=='blue'>
	<link rel="stylesheet" type="text/css" href="/css/common-blue.css">
<#else>
	<link rel="stylesheet" type="text/css" href="/css/common-green.css">
</#if>

<link rel="stylesheet" type="text/css" href="/css/controller.css" />

<!-- easyui -->
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/easyui/jquery.portal.js"></script>
<script type="text/javascript" src="/easyui/easyui-lang-zh_CN.js"></script>
<!-- layer -->
<script type="text/javascript" src="/layer/layer.js"></script>
<!-- 日历插件 -->
<script type="text/javascript" src="/My97DatePicker/WdatePicker.js" charset="UTF-8"></script>
<!-- 统计图表 -->
<script type="text/javascript" src="/WebApplication1/charts.js"></script>	
<script type="text/javascript" src="/WebApplication1/highcharts/highcharts.js"></script>

<!-- websocket -->
<script src="/js/webapp.js"></script>

<!-- 富文本编辑器-->
<script src="/ckeditor/ckeditor.js"></script>
<!-- 主面板 -->
<script type="text/javascript" src="/js/main.js"></script>	
<title>OA系统</title>
<script>
$(function(){
	newcarlendra();
	$(".box").on("click",".calendar-prevmonth",function(){
		newcarlendra();
	})
	$(".box").on("click",".calendar-nextmonth",function(){
		newcarlendra();
	})
	$(".content-second-right").on("click",'.calendar-day',function(){
		console.log($(this).attr('id'));
		 if($(this).attr('id')!=undefined){
			 refreshPanel("/calendar/checkcalendar?id="+$(this).attr('id')+"", "查看日程")
		 }
	})
})
function newcarlendra(){
	var obj=$(".calendar-day");
	if(${calendar?size}>0){
		obj.each(function(){
			<#list calendar as cr>
			var str="${cr.smStartTime?string('yyyy,MM,dd')}";
			if(str[5]==0&&str[8]==0){
				if($(this).attr("abbr")=="${cr.smStartTime?string('yyyy,M,d')}"){
					$(this).attr("id","${cr.smId}");
					$(this).append("<i style='color:#e60e0e;font-size: 12px;' class='iconfont icon-hongqi'></i>")
				}
			}else if(str[5]==0&&str[8]!=0){
				
				if($(this).attr("abbr")=="${cr.smStartTime?string('yyyy,M,dd')}"){
					$(this).attr("id","${cr.smId}");
					$(this).append("<i style='color:#e60e0e;font-size: 12px;' class='iconfont icon-hongqi'></i>")
				}
			}else if(str[5]!=0&&str[8]==0){
				if($(this).attr("abbr")=="${cr.smStartTime?string('yyyy,MM,d')}"){
					$(this).attr("id","${cr.smId}");
					$(this).append("<i style='color:#e60e0e;font-size: 12px;' class='iconfont icon-hongqi'></i>")
				}
			}else{
				if($(this).attr("abbr")==str){
					$(this).attr("id","${cr.smId}");
					$(this).append("<i style='color:#e60e0e;font-size: 12px;' class='iconfont icon-hongqi'></i>")
				}
			}
			</#list>
		})
	}
}
</script>
</head>
<body class="easyui-layout" data-id="${Session.userinfo.id}">
    <div class="main-top" data-options="region:'north',border:false">
    	<a class="main-logo" onclick="window.location.reload()">
    		<img alt="商标" src="/images/bilibili.png" width="160px" height="45px">
   		</a>
    	<a class="mini-logo" href="javaScript:void(0)">
    		<img alt="商标" src="/images/mini-bilibili.png" width="40px" height="40px">
   		</a>
   		
    	<a class="mini-toggle" href="javaScript:void(0)">
    		<i class="iconfont icon-gengduoa"></i>
    	</a>
    	<div class="main-topMenu">
    		<ul>
    			<li>
    				<a class="main-top-icon" href="/announce/list" title="通知列表">
    					<i class="iconfont icon-remind"></i>
    					<#if noticeCount!=0>
	    					<span id="notice-count" data-count="${noticeCount}" class="remind-text">${noticeCount}</span>
	    				<#else>
	    					<span id="notice-count" data-count="${noticeCount}" class="remind-text" style="display: none;">${noticeCount}</span>
    					</#if>
    				</a>
    			</li>
    			<!-- <li>
    				<a class="main-top-icon" href="javaScript:void(0)" title="写邮件">
    					<i class="iconfont icon-mail"></i>
    					<span class="remind-text">1</span>
    				</a>
    			</li>
    			<li>
    				<a class="main-top-icon" href="javaScript:void(0)" title="写笔记">
    					<i class="iconfont icon-edit"></i>
    				</a>
    			</li>
    			<li>
    				<a class="main-top-icon" href="javaScript:void(0)" title="通讯录">
    					<i class="iconfont icon-phone_surface"></i>
    				</a>
    			</li> -->
    			<li>
    				<a class="main-top-icon" href="/discuss?comment=0" title="论坛">
    					<i class="iconfont icon-commentso"></i>
    					<!-- <span class="remind-text">3</span> -->
    				</a>
    			</li>
    			<li>
    				<a class="main-top-icon top-userinfo" href="javaScript:void(0)">
    					<#if userinfo.photo??&&userinfo.photo!=''>
	    					<img class="user-head" alt="用户头像" src="/file/image/${Session.userinfo.photo}" width="25px" height="25px">
						<#else>
	    					<img class="user-head" alt="用户头像" src="/images/default-head.jpg" width="25px" height="25px">
						</#if>
    					<span>${userinfo.name}</span>
    				</a>
    				<div class="user-info">
    					<#if userinfo.photo??&&userinfo.photo!=''>
	    					<img class="user-head" alt="用户头像" src="/file/image/${Session.userinfo.photo}" width="90px" height="90px">
						<#else>
	    					<img class="user-head" alt="用户头像" src="/images/default-head.jpg" width="90px" height="90px">
						</#if>
						<p>${userinfo.deptOffice.name}/${userinfo.dept.name}</p>
						<p class="user-role">
							<#if userinfo.roles??>
								<#list userinfo.roles as r>
									${r.name}
								</#list>
							</#if>
						</p>
						<div class="user-use">
							<a style="color:#666666;;background-color:#f4f4f4;float:left;" href="/user">用户面板</a>
							<a style="color:white;background-color:#ec0707;float:right;" onclick="logout()">退出登录</a>
						</div>
					</div>
    			</li>
    			<li>
    				<a class="main-top-icon top-history" href="javaScript:void(0)" title="历史记录">
    					<i class="iconfont icon-time-back"></i>
    				</a>
    				<div class="history-record">
    					<div>
    						<span>今天   (${.now?date})</span>
    						<a title="清空" style="text-align: right;height: 30px;color: #999;" onclick="clearHistory()">清空历史记录</a>
    					</div>
    					<ul>
 							<li class="none"><a>历史记录为空~</a></li>
    					</ul>	
    				</div>
    			</li>
    		</ul>
    	</div>
    </div>
    <div class="main-left" data-options="region:'west',border:false" style="width:230px;background-color: #222d32;">
    	<div class="main-userinfo">
    		<#if userinfo.photo??&&userinfo.photo!=''>
				<img class="user-head" alt="用户头像" src="/file/image/${userinfo.photo}" width="45px" height="45px">
			<#else>
				<img class="user-head" alt="用户头像" src="/images/default-head.jpg" width="45px" height="45px">
			</#if>
    		<div class="info">
    			<p style="font-size: 15px;font-weight: bold;padding-top: 10px;">${userinfo.name}</p>
    			<i id="connect-state" class="iconfont icon-circle text-success" style="font-size: 12px;margin-right:10px;"></i>
    			<select onchange="isConnect(this)" style="border: none;background-color: #222d32;color: #fff;">
    				<option value="1">在线</option>
    				<option value="0">离线</option>
    			</select>
    		</div>
    		<!-- <div class="menu-search">
	    		<input type="text" placeholder="请输入关键字...">
	    		<a href="javaScript:void(0)" class="main-left-icon"><i class="iconfont icon-search"></i></a>
    		</div> -->
    	</div>
		<ul id="main-menu" class="zjy-menu">
			<#list menus as m>
				<#if !m.parent??>
					<li class="father-menu">
						<a>
							<i class="iconfont ${m.icon}"></i>
							<span>${m.text}</span>
							<i class="fixicon iconfont icon-return"></i>
						</a>
						<ul class="son-menu">
							<#list menus as child>
								<#if child.parent?? && child.parent.id==m.id>
									<li>
										<a href="${child.href}">
											<i class="iconfont ${child.icon}"></i>
											<span>${child.text}</span>
										</a>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
				</#if>
			</#list>
		</ul>
    </div>
    <div id="main-center" class="main-center" data-options="region:'center',border:false" style="padding:5px;background: #ECF0F5;">
    		<#include "/head.ftl"/>
		<!--
    	作者：1071766245@qq.com
    	时间：2017-08-19
    	描述：控制面板的内容
    -->
		<div class="content">

			<div class="content-row">
				<!--
                	作者：1071766245@qq.com
                	时间：2017-08-19
                	描述：考勤上班
                -->
				<div class="content-one">
					<div class="content-row-one" id="content-one-blue">
						<div class="content-row-one-time">
							<h3 class="time">12:45</h3>
							<p>上班：<span class="go">${userinfo.dept.beginTime?string("HH:mm")}</span></p>
							<p>下班：<span class="out">${userinfo.dept.endTime?string("HH:mm")}</span></p>
						</div>
						<div class="content-row-one-timeicon">
							<#if !sign?exists>
								<span class="type">签到</span>
							<#else>
								<#if signout?exists>
									<span data-outid="${signout.id}" class="type">签退</span>
								<#else>
									<span class="type">签退</span>
								</#if>
							</#if>
						</div>
						<a title="我的考勤" href="/work/attend/my" class="content-row-one-foot">更多<i class="iconfont icon-youjiantou"></i></a>
					</div>
				</div>
				<!--
                	作者：1071766245@qq.com
                	时间：2017-08-19
                	描述：文件管理
                -->
				<div class="content-one">
					<div class="content-row-one" id="content-one-green">
						<div class="content-row-one-time" style="height: 105px">
							<h3>文件管理</h3>
						</div>
						<div class="content-row-one-timeicon">
							<a href="/file/file" style="cursor: pointer;"><i class="iconfont icon-wenjianguanli" id="clock-icon"></i></a>
						</div>
						<a href="/file/file" class="content-row-one-foot">更多<i class="iconfont icon-youjiantou"></i></a>
					</div>
				</div>
				<!--
                	作者：1071766245@qq.com
                	时间：2017-08-19
                	描述：通讯类
                -->
				<div class="content-one">
					<div class="content-row-one" id="content-one-yellow">
						<div class="content-row-one-time" style="height: 105px">
							<h3>通讯录</h3>
						</div>
						<div class="content-row-one-timeicon">
							<a href="/address" style="cursor: pointer;"><i class="iconfont icon-phone_surface" id="clock-icon"></i></a>
						</div>
						<a href="/address" class="content-row-one-foot">更多<i class="iconfont icon-youjiantou"></i></a>
					</div>
				</div>

				<!--
                	作者：1071766245@qq.com
                	时间：2017-08-19
                	描述：讨论区
                -->
				<div class="content-one">
					<div class="content-row-one" id="content-one-red">
						<div class="content-row-one-time" style="height: 105px">
							<h3>讨论区</h3>
							
						</div>
						<div class="content-row-one-timeicon" style="right: 25px;">
							<a href="/discuss?comment=0" style="cursor: pointer;"><i class="iconfont icon-taolun1" id="clock-icon"></i></a>
						</div>
						<a href="/discuss?comment=0" class="content-row-one-foot">更多<i class="iconfont icon-youjiantou"></i></a>
					</div>
				</div>
			</div>

			<div class="content-second-row">
				<div class="content-second-row-section" id="content-second-row-left">
				
				<!-- 公告通知-->
					<div class="box" title="公告通知">
						<div class="box-header" style="display: none;">
							<h3>公告通知</h3>
							<div class="right-icon">
								<div style="display: inline-block;">
									<button class="btn-show">
										<i class="iconfont icon-gengduoa"></i>
									</button>
									<ul class="left-icon-menu">
										<li>
											<a class="hello">hello</a>
										</li>
										<li>
											<a class="hello">hello</a>
										</li>
									</ul>
								</div>
								<button class="btn-min">
									<i class="iconfont icon-minimize"></i>
								</button>
								<button class="btn-close">
									<i class="iconfont icon-guanbi"></i>
								</button>
							</div>
						</div>
						<div class="box-table">
							<table style="text-align: center;border-collapse: collapse;">
								<tbody>
									<tr>
										<th style="width: 18%;">类型</th>
										<th style="width: 18%;">日期</th>
										<th style="width: 19%;">标题</th>
										<th style="width: 40%;">状态</th>
										<!-- <th>&nbsp;&nbsp;&nbsp;</th> -->
									</tr>
									<#list ann as an>
									<#if an_index lt 4>
										<tr>
											<td>
												<#list types['announce'] as ta>
													<#if ta.value==an.type><span class="label" style="color: ${ta.color}">[${ta.name}]</span></#if>
												</#list>
												
											</td>
											<td>${an.time?string('yyyy-MM-dd')}</td>
											<td>
											<span>
												${an.title}
											</span>
											</td>
											<td>
												<#list status['announce'] as sa>
													<#if sa.value==an.status><span class="label" style="background-color: ${sa.color}">${sa.name}</span></#if>
												</#list>
											</td>
											<td>
												<!-- <a><span class="find-icon" style="padding: 3px 5px; font-size: 9pt;">
												<i class="iconfont icon-chazhao1"style="font-size: 12px;margin-right: 1px;"></i>查看
											</span></a> -->
											</td>
										</tr>
									</#if>
									</#list>
								</tbody>
							</table>
						</div>
					</div>
					<!-- 本周系统使用次数-->
					<!-- <div class="box" title="本周系统使用次数">
						<div class="box-table" style="overflow-x: scroll;">
							<div id="container1" style="width:100%; height: 300px; margin: 0 auto"></div><br />
						</div>
					</div> -->

					<!-- 流程管理 -->
					<div class="box" title="审批管理 ">
						
						<div class="box-table">
							<table style="text-align: center;border-collapse: collapse;">
								<tbody>
									<tr>
										<th style="width: 18%;">主题</th>
										<th style="width: 18%;">时间</th>
										<th style="width: 19%;">状态</th>
										<th style="width: 40%;">审批人</th>
										<th>&nbsp;&nbsp;&nbsp;</th>
									</tr>
									<#list applys as apply>
									<#if apply_index lt 4>
										<tr>
											<td>${apply.title}</td>
											<td>${apply.time?string('yyyy-MM-dd')}</td>
											<td>
												<span>
													<#list status['apply'] as sa>
														<#if sa.value==apply.status><span class="label" style="background-color: ${sa.color}">${sa.name}</span></#if>
													</#list>
												</span>
											</td>
											<td>${apply.deptOffice.name}</td>
											<td>
												<a href="/apply/show?id=${apply.id}" title="查看详情"><span class="find-icon" style="padding: 3px 5px; font-size: 9pt;">
												<i class="iconfont icon-chazhao1"style="font-size: 12px;margin-right: 1px;">
													
												</i>查看
											</span></a>
											</td>
										</tr>
										</#if>
									</#list>
								</tbody>
							</table>
						</div>
					</div>

					<!-- 工作计划 -->

					<div class="box" title="最近任务">
						
						<div class="box-table">
							<table style="text-align: center;border-collapse: collapse;">
								<tbody>
									<tr>
										<th style="width: 18%;">类型</th>
										<th style="width: 18%;">标题</th>
										<th style="width: 19%;">时间</th>
										<th style="width: 40%;">状态</th>
										<th>&nbsp;&nbsp;&nbsp;</th>
									</tr>
									<#list tasklist?sort_by('tmPushTime')?reverse as task>
										<#if task_index lt 4>
											<tr>
												<#list status['task_manage_type'] as status>
													<#if status.value==task.type>
														<td><span style="background:${(status.color)!''}" class="btn">${status.name}</span></td>		
													</#if>
												</#list>
												<td>${task.tmTitle}</td>
												<td>${task.tmPushTime?string('yyyy-MM-dd')}</td>
												<#list status['task_manage_status'] as status>
													<#if status.value==task.tmStatus>
														<td><span class="btn" style="background:${(status.color)!''}" class="btn">${status.name}</span></td>		
													</#if>
												</#list>
												<td>
													<a href="/task/showTask?id=${task.tmId}" title="查看任务"><span class="find-icon" style="padding: 3px 5px; font-size: 9pt;">
													<i class="iconfont icon-chazhao1"style="font-size: 12px;margin-right: 1px;"></i>查看
												</span></a>
												</td>
											</tr>
										</#if>
									</#list>
								</tbody>
							</table>
						</div>
					</div>
				</div>

				<div class="content-second-right">
					<!--                  
                   		 行事历
                    -->
					<div class="box" title="<i class='iconfont icon-rili' style='margin-right: 6px'></i>行事历">
						<div>
							<div class="easyui-calendar" style=" height: 300px;"></div>
						</div>
					</div>
					<!--任务完成排行-->
					<div class="box" title="任务完成报表">					
						<div>
							<div id="container2" style="width:98%; height: 300px; margin: 0 auto"></div><br />
						</div>
					</div>
					
					<!--                  
                    	我的便签
                    -->
					<!-- <div class="box" title="<i class='iconfont icon-bi1' style='margin-right: 6px'></i>我的便签">
						

						<div>
							<div class="chat">
								<div class="item">
									<img src="/images/default-head.jpg" class="online-image" />
									<p class="message">
										<a class="name">标题
											<small class="text-time">
											<i class="iconfont icon-time" style="font-size: 13px;"></i>
											1997-08-12
										</small>
										</a>
										敲代码喵喵喵？？？？
									</p>
								</div>

							</div>
							<div class="chat-foot">
								<div class="input-group">
									<input class="input-group-input" />
									<div class="input-group-up">
										<a class="input-group-up-a"><i class="iconfont icon-add-copy" style="color: white;"></i></a>
									</div>
								</div>
							</div>
						</div>
					</div> -->
				</div>
			</div>
		</div>
    </div>
</body>
</html>